package com.traffic.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.traffic.constant.Status;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.traffic.entity.Rank;
import com.traffic.mapper.RankMapper;
import com.traffic.service.RankService;

@Service
public class RankServiceImpl extends ServiceImpl<RankMapper, Rank> implements RankService{

    @Autowired
    private RankMapper rankMapper;

    @Override
    public Rank selectByUserId(Long userid) {
        QueryWrapper<Rank> wrapper = new QueryWrapper<>();
        return rankMapper.selectOne(wrapper.eq("user_id",userid));

    }

    @Override
    public Object selectTargetObject(Object iid, String type) {
        QueryWrapper<Rank> wrapper = new QueryWrapper<>();
        return rankMapper.selectObjs(wrapper.select(type).eq("user_id",iid));

    }

}
